
//
//  CTNewFeatureCell.m
//  jdforme
//
//  Created by leo on 2017/5/18.
//  Copyright © 2017年 leojingdong.com. All rights reserved.
//

#import "CTNewFeatureCell.h"
#import "UIView+CTFrame.h"
@interface CTNewFeatureCell ()
@property (nonatomic, weak) UIButton *startButton;
@end
@implementation CTNewFeatureCell


-(UIButton *)startButton {
    if (_startButton == nil) {
        
        UIButton *tempButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [tempButton setImage:[UIImage imageNamed:@"functionGuideBt1"] forState:UIControlStateNormal];
        [tempButton setImage:[UIImage imageNamed:@"functionGuideBt2"] forState:UIControlStateHighlighted];
        [tempButton sizeToFit];
        [tempButton addTarget:self action:@selector(startJd:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:tempButton];
        _startButton = tempButton;
    }
    return _startButton;
    
}
- (void)setCurrentPageIndex:(NSInteger)currentIndex lastPageIndex:(NSInteger)laseIndex {
    if (currentIndex == laseIndex) {
        self.startButton.hidden = YES;
    } else {
        self.startButton.hidden = NO;
    }
}
- (void)startJd:(UIButton *)button {
    
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.startButton.center = CGPointMake(self.frameWidth * 0.5, self.frameHeight * 0.5);
}
@end
